<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="public/css.css"> 
<?php
require_once './model/dp2.php';

$pages = getpages($query);
?>
<form method="POST">
    Min Page :  <input type="text" name="Min">
    Max Page :   <input type="text" name="Max">
    <input type="submit" name="submit" value="SEACH">
</form>

    <?php if (isset($_POST['submit'])): ?>
    <?php $min = (double) $_POST['Min']; ?>
    <?php $max = (double) $_POST['Max']; ?>


<table border="1">
    <tr>
<th> PID </th>
<th> PICTURE </th>
<th> ID </th>
<th> NAME </th>
<th> USER NAME </th>
<th> PHONE </th>
<th> LIKES </th>
<th> TALKING ABOUT COUNT </th>
<th> CATEGORY </th>
<th> LINK </th>
<th> URL </th>
<th> WEBSITE </th>
<th> STREET </th>
<th> CITY </th>
<th> COUNTRY </th>
<th> DESCRIPTION </th>
<th> ABOUT </th>
<th> NOTE </th>
<th> DATE </th>
<th> STATUS </th>
        
    </tr> 
    
    <?php foreach ($pages as $page): ?> 
    <?php if ((int) $_GET . $page['likes'] >= ((int)$_POST['Min'])
                   &&(int) $_GET . $page['likes'] <= ((int)$_POST['Max'])): ?>
    
        
    <tr>
            <td><?php echo $page["pid"] ?></td> 
            <td><img src = '<?php echo $page["picture"]?>'></td>
            <td><?php echo $page["id"] ?></td>
            <td><?php echo $page["name"] ?></td>
            <td><?php echo $page["username"] ?></td>
            <td><?php echo $page["phone"] ?></td>
            <td><?php echo $page["likes"] ?></td>
            <td><?php echo $page["talking_about_count"] ?></td>
            <td><?php echo $page["category"] ?></td>
            <td><?php echo $page["link"] ?></td>
            <td><?php echo $page["url"] ?></td>
            <td><?php echo $page["website"] ?></td>           
            <td><?php echo $page["street"] ?></td>
            <td><?php echo $page["city"] ?></td>
            <td><?php echo $page["country"] ?></td>
            <td><?php echo $page["description"] ?></td>
            <td><?php echo $page["about"] ?></td>
            <td><?php echo $page["note"] ?></td>
            <td><?php echo $page["date"] ?></td>
            <td><?php echo $page["status"] ?></td>
            
        </tr>
     <?php endif; ?>
    <?php endforeach; ?>
</table>
<?php endif; ?>
